package com.yq.homework.day21;

import java.util.Arrays;
import java.util.logging.Level;

/**
 * @author 3307235355@qq.com
 * @since 2022/06/22 15:24
 *
 * 把字符串"lengendary"中字符 改成间隔大写小写模式，
 * 即 "LeNgEnDaRy"
 * 提示:
 * 借助StringAPI
 * toLowerCase() 把字符串全部转化为小写
 * String toUpperCase() 把字符串全部转换为大写
 */
public class Demo02 {
    public static void main(String[] args) {
        String s ="lengendary";
        String result ="";
        for (int i = 0; i < s.length(); i++) {
            if (i%2==0){
                char c = s.charAt(i);
                result +=String.valueOf(c).toUpperCase();
            }else {

                char c = s.charAt(i);
                result +=String.valueOf(c).toLowerCase();
            }

        }
        System.out.println(result);
    }
}
